package cn.biplam.common.client.paging;

import cn.biplam.common.bean.sqlengine.Sql;
import cn.biplam.common.client.Database;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.common.wrapper.sqlresult.SqlResult;

/**
 * 公共分页类
 * 用ResultSet进行分页
 * @author WangSong 2009-8-6下午08:08:33
 * @version 1.0
 */
public class PagingCommen {
	
	public SqlResult getPaging(Database database,String sql,int start,int end) throws ErrorMessage{
		return execute(database, sql,start,end);
	}
	
	/**
	 * 分页
	 * @param database
	 * @param sql
	 * @return 
	 * @throws ErrorMessage
	 */
	private SqlResult execute(Database database,String sql,int start,int end) throws ErrorMessage{
		SqlResult sr = database.executeSelect(new Sql(sql),start,end);		
		return sr;
	}
	
	
}
